﻿#include "awtk.h"
#include "gesture_lock/gesture_lock.h"

static ret_t on_reset_password(void* ctx, event_t* e) {
  widget_t* win = WIDGET(ctx);
  widget_t* gesture_lock = widget_lookup(win, "lock", TRUE);
  
  if (gesture_lock != NULL) {
    gesture_lock_reset_password(gesture_lock);
  }

  return RET_OK;
}

/**
 * 初始化
 */
ret_t application_init(void) {
  gesture_lock_register();

  widget_t* win = window_open("main");
  widget_child_on(win, "reset_password", EVT_CLICK, on_reset_password, win); 

  return RET_OK;
}

/**
 * 退出
 */
ret_t application_exit(void) {
  log_debug("application_exit\n");
  return RET_OK;
}
